package com.click.app.model.storage;

<%-- 
    Document   : purchaseForm
    Created on : 14/04/2009, 09:59:21 AM
    Author     : Joel Chuca
--%>

<%@ include file="/common/taglibs.jsp"%>
<%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %>

<head>
    <title><fmt:message key="purchase.title"/></title>
    <meta name="heading" content="<fmt:message key='purchase.heading'/>"/>
    <meta name="menu" content="RolePurchaser"/>
    <!--link rel="stylesheet" type="text/css" media="all" href="styles/calendar-aqua/theme.css" /-->
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>" ></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>" ></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>" ></script>
    <script type="text/javascript">
        window.onload = function() {
            Calendar.setup({
                inputField: "dateStartID",
                ifFormat: "%d/%m/%Y",
                button: "dateStartID"
            });

            Calendar.setup({
                inputField: "dateEndID",
                ifFormat: "%d/%m/%Y",
                button: "dateEndID"
            });
        }

        function modifyStateMonth(){
            if(document.getElementById("forMonth").checked){
                document.getElementById("dateStartID").disabled =false;
                document.getElementById("dateEndID").disabled =false;
            }
            else{
                document.getElementById("dateStartID").disabled =true;
                document.getElementById("dateEndID").disabled =true;
            }
        }

    </script>
</head>

<c:if test="${not empty material.id}">
    <s:submit cssClass="button" method="delete" key="button.delete" onclick="return confirmDelete('material')" theme="simple"/>
</c:if>
<s:form id="purchaseMount" action="generateSupplierPurchaseReport" method="post" validate="true">
    <s:hidden key="purchase.id" cssClass="text medium"/>
    <fieldset>
        <table border="0">
            <thead>
                <tr>
                    <th>Fecha inicio</th>
                    <th>Fecha fin</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <s:textfield key="dateStart" id="dateStartID" required="true" cssClass="text medium"/>
                    </td>
                    <td>
                        <s:textfield key="dateEnd" id="dateEndID" required="true" cssClass="text medium"/>
                    </td>
                </tr>
            </tbody>
        </table>
    </fieldset>

    <li class="buttonBar bottom">
        <s:submit cssClass="button" method="generateSupplierPurchaseReport" key="Generate" theme="simple"/>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
    </li>    
</s:form>

<cewolf:chart
    id="verticalbar"
    title="Page View Statistics"
    type="verticalbar"
    xaxislabel="Page"
    yaxislabel="Views">
    <cewolf:data>
        <cewolf:producer id="report"/>
    </cewolf:data>
</cewolf:chart>
<p>
<cewolf:img chartid="verticalbar" renderer="/cewolf" width="400" height="300">
</cewolf:img>

<script type="text/javascript">
    Form.focusFirstElement($("materialForm"));
</script>